﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace PhoenixCrabV6.Engine.Images
{
    public class ScreenLayer
    {
        /// <summary>
        /// Images that are shown on this Layer. They get drawn in order
        /// </summary>
        public List<IDrawable> LayerComponents;

        //TODO Mouse interface areas list
        //TODO ScreenImageEffect is different from imageeffect - define different effects

        public ScreenLayer()
        {
            LayerComponents = new List<IDrawable>();
        }

        public void LoadContent()
        {
            LayerComponents.ForEach(x => x.LoadContent());
        }

        public void UnloadContent()
        {
            LayerComponents.ForEach(x => x.UnloadContent());
        }

        public void Update(GameTime gameTime)
        {
            LayerComponents.ForEach(x => x.Update(gameTime));
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            LayerComponents.ForEach(x => x.Draw(spriteBatch));
        }
    }
}
